package cloudgamesaumysql

import (
	"github.com/shopspring/decimal"
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/11/21 14:56
*/

// CGGameAUUserPurchaseOrder 云游戏（劲舞团）AU用户消费订单表
type CGGameAUUserPurchaseOrder struct {
	ID                         int64           `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	Phone                      string          `json:"phone" gorm:"column:phone;type:varchar(20);not null;default:'';comment:用户手机号"`
	GameTransactionOrderNumber string          `json:"game_transaction_order_number" gorm:"column:game_transaction_order_number;type:varchar(128);default:'';not null;comment:游戏方消费订单单号"`
	PurchaseObjectName         string          `json:"purchase_object_name" gorm:"column:purchase_object_name;type:varchar(64);not null;default:'';comment:消费对象名称"`
	OrderAmount                decimal.Decimal `json:"order_amount" gorm:"column:order_amount;type:decimal(12,2);not null;default:0.00;comment:消费金额"`
	IsRefund                   int             `json:"is_refund" gorm:"column:is_refund;type:tinyint;not null;default:0;comment:是否退款 0未退款 1部分退款 2全额退款"`
	RefundOrderAmount          decimal.Decimal `json:"refund_order_amount" gorm:"column:refund_order_amount;type:decimal(12,2);not null;default:0.00;comment:退款金额"`
	RefundTime                 time.Time       `json:"refund_time" gorm:"column:refund_time;type:datetime;default:null;comment:退款时间"`
	CreatedAt                  time.Time       `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt                  time.Time       `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt                  gorm.DeletedAt  `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAUUserPurchaseOrder) TableName() string {
	return "cg_game_au_user_purchase_order"
}
